package cn.edu.zafu.bigdata.cccnnn.workthree;
import java.util.Scanner;

class InvalidScoreException extends Exception{
    public InvalidScoreException(String message){
        super(message);
    }
}

class Checkscore{
    public static void checkScore(int score) throws InvalidScoreException{
        if (score < 0 || score > 100){
            throw new InvalidScoreException("Printing grades is not valid.");
        }
        else System.out.println("Printing grades is valid.");
    }
}

public class TestInvalidScoreException {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        System.out.print("Enter a score:");
        int score = scanner.nextInt();
        try {
            Checkscore.checkScore(score);
        } catch (InvalidScoreException e) {
            System.out.println(e.getMessage());
        }
        scanner.close();

    }
}
